
package com.jf.cloud.product.controller.app;

import com.jf.cloud.common.product.vo.GiveawayVO;
import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.product.service.GiveawayService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 赠品表
 *
 * @author zz
 * @date 2022-08-16 11:11:58
 */
@RestController("appGiveawayController")
@RequestMapping("/giveaway")
@Tag(name = "app-赠品表")
public class GiveawayController {

    @Autowired
    private GiveawayService giveawayService;



    @GetMapping("/info/{spuId}")
    @Operation(summary = "通过商品id查询赠品信息" , description = "通过商品id查询赠品")
    public ServerResponseEntity<GiveawayVO> getById(@PathVariable("spuId") Long spuId) {
        GiveawayVO giveawayVO = giveawayService.getGiveawaySpuBySpuId(spuId);
        return ServerResponseEntity.success(giveawayVO);
    }

}


